<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddRepayRecordRepayPlanNumber extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('repay_records', function (Blueprint $table) {
            $table->integer('repay_plan_number')->default(0)->index()->comment('老卡贷催收唯一标示');
        });
        Schema::table('repay_summaries', function (Blueprint $table) {
            $table->tinyInteger('repay_type')->default(0)->index()->comment('标示快闪卡贷版本，财务区分，0:快闪卡贷2，1:快闪卡贷，2:快闪卡贷1');
        });


    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        if(Schema::hasTable('repay_records')){
            Schema::table('repay_records', function (Blueprint $table) {
                $table->dropColumn('repay_plan_number');
            });
        }

        if(Schema::hasTable('repay_summaries')){
            Schema::table('repay_summaries', function (Blueprint $table) {
                $table->dropColumn('repay_type');
            });
        }



    }
}
